(function($) {
	
	var LOWER = /[a-z]/,
		UPPER = /[A-Z]/,
		DIGIT = /[0-9]/,
//		DIGITS = /[0-9].*[0-9]/,
		SPECIAL = /[^a-zA-Z0-9]/,
		SAME = /^(.)\1+$/;
		

	$.validator.passwordRating = function(password) {

        var lower = LOWER.test(password),
                upper = UPPER.test(password),
                digit = DIGIT.test(password),
//			digits = DIGITS.test(password),
                special = SPECIAL.test(password);
//        alert(lower+"||"+upper+"||"+digit+"||"+special);

        return lower && upper && digit || lower && upper && special || lower && digit && special || upper && digit && special;


    };
	

	$.validator.addMethod("password", function(value, element) {
		var password = element.value;

		var rating = $.validator.passwordRating(password);

		return this.optional(element)||rating;
	}, "密码必须包括至少含大写字母,小写字母,符号,数字中的三种");

})(jQuery);
